<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>The CheckBox Tree with third party widget </title>
<!--
  This demo uses a third party widget 'TriStateCheckbox' instead of the default
  cbtree multi-state checkbox.  Note: for this demo checked state normalization
  is turned off allowing ALL checkboxes to cycle thru all possible states.
-->
     <style type="text/css">
      @import "../../../dijit/themes/claro/claro.css";
      @import "../../../dijit/themes/claro/document.css";
      @import "../../../dijit/tests/css/dijitTests.css";
      @import "../../../dojox/form/resources/TriStateCheckBox.css";
      @import "../../themes/claro/claro.css";
    </style>

    <script type="text/javascript">
      var dojoConfig = {
            async: true,
            parseOnLoad: true,
            isDebug: true,
            baseUrl: "../../../",
            packages: [
              { name: "dojo",  location: "dojo" },
              { name: "dojox",  location: "dojox" },
              { name: "dijit", location: "dijit" },
              { name: "cbtree",location: "cbtree" }
            ]
      };
    </script>
    <script type="text/javascript" src="../../../dojo/dojo.js"></script>
    <script type="text/javascript">
      require([
        "dojo/data/ItemFileWriteStore",
        "dojo/ready",
        "dojox/form/TriStateCheckbox",
        "cbtree/Tree",                      // CheckBox Tree
        "cbtree/models/ForestStoreModel"    // Tree Forest Store Model
        ], function( ItemFileWriteStore, ready, TriStateCheckBox, Tree, ForestStoreModel ) {

          var store = new ItemFileWriteStore( { url: "../../data/json/Simpsons.json" });
          var model = new ForestStoreModel( {
                  store: store,
                  query: {type: 'parent'},
                  rootLabel: 'The Simpsons',
                  checkedRoot: true,
                  normalize: false
                  });

          ready(function() {
            var tree = new Tree( {
                    model: model,
                    id: "MenuTree",
                    widget: { type: TriStateCheckBox, args: { states:['mixed', true, false] }}
                    }, "CheckboxTree" );
            tree.startup();
          });
        });
    </script>
  </head>

  <body class="claro">
    <h1>The CheckBox Tree - Mixin Widget: &lt;TriStateCheckBox&gt;</h1>
    <p>
			Mixin a thrid party widget instead of the default checkbox. This demo requires dojox installed on your platform.
    </p>
    <div id="CheckboxTree">
    </div>
  </body>
</html>